package com.aqie.haikang.dorm.crontab;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.time.LocalDateTime;

/**
 * @Author aqie
 * @Date 2021/12/11 13:39
 * @desc 1. 静态基于注解
 */
@Slf4j
// @Configuration
@EnableScheduling
@EnableAsync
public class StaticScheduleTask {
    //3.添加定时任务 0 0/10 15,16 * * ?
    @Scheduled(cron = "0 0/10 22,23 * * ?")
    @Async
    public void configureTasks() {
        log.info("执行静态定时任务时间: " + LocalDateTime.now());
    }
}
